/*
	This file is part of PropExtractor.

	AliceDecrypt is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	AliceDecrypt is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with PropExtractor. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _PEALICESOFTZIP_H_
#define _PEALICESOFTZIP_H_

#include "PEIncludes.h"

#include "PEFile.h"

namespace pe
{

	struct AliceZipFileHeader
	{
		dword offset;
		byte something[8];	
	};

	struct AliceZipFile
	{
		char* path;
		AliceZipFileHeader* header;
	};

	struct AliceZipHeader
	{
		byte header[3];
		byte something1[5];
		dword number_of_files;
	};

	struct AliceZip
	{
		char* workingdir;
		PEFile* handle;
		AliceZipHeader* header;
		AliceZipFile* files;
		unsigned int files_total;
	};

	int AliceZipReadHeader(AliceZip* a_Target, PEFile* a_File);
	int AliceZipOpenFile(PEFile* a_Target, AliceZip* a_Zip, unsigned int a_Index);
	int AliceZipExtractFile(AliceZip* a_Zip, unsigned int a_Index, const char* a_Pattern = NULL);
	int AliceZipSaveImageToFile(AliceZip* a_ZipFile, unsigned int a_Index, const char* a_Pattern = NULL);

}; // namespace pe

#endif